//
//  NKTableViewCell.m
//  NewKY
//
//  Created by admin on 16/11/13.
//  Copyright © 2016年 Dee. All rights reserved.
//

#import "NKTableViewCell.h"
#import <YYKit.h>
#import <Masonry.h>


@interface NKTableViewCell ()

@end

@implementation NKTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
    }
    
    return self;
}


-(void)setModel:(NKModel *)model{
    _model = model;
    NSString *img = model.icon;
    self.imageView.image = [UIImage imageNamed:img];
}

 /*---- 添加label, 填写个人信息 -----*/
-(UILabel *)label{
    if(_label == nil){
        
        UILabel *detailLabel=[[UILabel alloc] init];
        detailLabel.backgroundColor=[UIColor whiteColor];
        detailLabel.font = [UIFont systemFontOfSize:13];
        detailLabel.textAlignment=NSTextAlignmentRight;
        detailLabel.textColor=[UIColor grayColor];
        detailLabel.userInteractionEnabled = YES;
        
        [self.contentView addSubview:detailLabel];
        [detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(self.contentView).offset(-10);
            make.top.bottom.mas_equalTo(self.contentView);
            make.width.mas_equalTo(180);
        }];
        
        return detailLabel;
    }
    return _label;
}




@end
